<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="net.sf.json.JSONObject"%>
<%@ page import="com.houdoudou.bean.*"%>
<% List<Financer> financers= new ArrayList<Financer>(); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<%@ include file="validSupperProgrammer.jsp" %> 
</head>
<body>

<h1 align="center">财务人员管理</h1>    
  
        <form action="<%=request.getContextPath()%>/programmerServletJsp">
    <input type="hidden" name="affair" value="searchFinancer" /><br/>
    电话： <input type="text" name="telnum"  />
    <input type="submit" value="搜索"> <br/>
    </form> 
   
<table width="100%">
 <tr>  <th style="BACKGROUND-COLOR: #FF0000" width="25%" >电话</th>  <th style="BACKGROUND-COLOR: #FF0000"  width="25%">类型</th>  <th width="25%" style="BACKGROUND-COLOR: #FF0000"> 密码</th>  <th width="25%" style="BACKGROUND-COLOR: #FF0000"> 操作</th> </tr> 

 <% boolean success; 
    Object temp =request.getAttribute("success");
     if(temp==null){
     success=false;
     }else{
       success= (Boolean) temp;
     }
    if(success) {
     financers= ( List<Financer>) request.getAttribute("financers"); }
    
   
        for (int i = 0; i < financers.size(); i++) {     
             pageContext.setAttribute("programmer", financers.get(i));   
             if(financers.get(i).getType()==1){pageContext.setAttribute("typeWord","超级财务员"); }   
             if(financers.get(i).getType()==2){pageContext.setAttribute("typeWord","普通财务员"); } 
                pageContext.setAttribute("row", i % 2 != 0 ? "odd" : "even"); %>           
                       <tr>           
                                    <td>${programmer.telnum}</td>        
                                    <td>${typeWord}</td>        
                                    <td>${programmer.secret}</td>          
                       <td> <a href="<%=request.getContextPath()%>/programmerServletJsp?affair=deleteFinancer&telnum=${programmer.telnum}">删除</a> </td>
                                  
                             </tr> 
<%} %>
  
 </table>  
 <br/>   <br/>   <br/>  
</body>
</html>
<script> 
//取出传回来的参数error并与yes比较
  var errorInfoA ='<%=request.getParameter("errorInfo")%>';
  var  errorInfo=decodeURI(errorInfoA);
  if(errorInfo!='null'){
   alert(errorInfo);}

</script>